<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

//首页
    Route::get('/', [App\Http\controllers\index\index::class,'index']);

//日常清洁
    Route::get('cleaning_index', [App\Http\controllers\index\index::class,'cleaning_index']);

//地板打蜡
    Route::get('floor', [App\Http\controllers\index\index::class,'floor']);

//会员充值
    Route::get('recharge', [App\Http\controllers\index\index::class,'recharge']);

//添加金额
    Route::post('recharge_add', [App\Http\controllers\index\index::class,'recharge_add']);

//开通会员
    Route::get('dredge_member', [App\Http\controllers\index\index::class,'dredge_member']);

//服务地址
    Route::get('address', [App\Http\controllers\index\index::class,'address']);

//添加地址
    Route::get('address_add', [App\Http\controllers\index\index::class,'address_add']);

//删除地址
    Route::get('delete_community',[\App\Http\Controllers\index\index::class,'delete_community']);

//搜索小区
    Route::get('address_search', [App\Http\controllers\index\index::class,'address_search']);

//确认订单
    Route::get('affirm_order', [App\Http\controllers\index\index::class,'affirm_order']);

//商品详情
    Route::get('WeiMeng', [App\Http\controllers\index\index::class,'WeiMeng']);

//订单页面
    Route::get('myorder', [App\Http\controllers\index\index::class,'myorder']);

//订单完成页面
    Route::get('order', [App\Http\controllers\index\index::class,'order']);

    //订单开始页面
    Route::get('order_start', [App\Http\controllers\index\index::class,'order_start']);

    Route::match(['get','post'],'myorder', [App\Http\controllers\index\index::class,'myorder']);

    //订单进行中
    Route::get('order_underway', [App\Http\controllers\index\index::class,'order']);

    Route::get('order_out', [App\Http\controllers\index\index::class,'order_out']);

//订单评价
    Route::get('evaluate', [App\Http\controllers\index\index::class,'evaluate']);

//我的
    Route::get('index_center', [App\Http\controllers\index\index::class,'index_center']);

//我的钱包
    Route::get('my_money', [App\Http\controllers\index\index::class,'my_money']);

//钱包
    Route::get('money', [App\Http\controllers\index\index::class,'money']);

//优惠劵
    Route::get('coupon', [App\Http\controllers\index\index::class,'coupon']);

//常见问题
    Route::get('problem_mould', [App\Http\controllers\index\index::class,'problem_mould']);

//会员中心
    Route::get('member_center', [App\Http\controllers\index\index::class,'member_center']);

//邀请分享
    Route::get('share', [App\Http\controllers\index\index::class,'share']);

//消息中心
    Route::get('news', [App\Http\controllers\index\index::class,'news']);

//Route::get('/', function () {
//    return view('welcome');
//});
Route::get('/admin',function (){
   return view('admin.index');
})->middleware('handle');
//后台首页
Route::prefix('admin')->group(function () {
    Route::get('/index', \Admin\IndexController::class . '@getSystemInit');
});
//登入
Route::prefix('admin')->group(function () {
    Route::get('/login',function(){
        return view("admin.login.login");
    });
    Route::any('/verify',\Admin\LoginController::class . '@verify');
});
//角色管理
Route::prefix('admin')->group(function () {
    Route::get('/role',function(){
        return view("admin.role");
    });
    Route::get("/role_table",\Admin\RoleController::class ."@role_table");
    Route::get('/role_add',function (){
        return view('admin.role_add');
    });
    Route::get("/role_json",\Admin\RoleController::class ."@role_json");
    Route::post("/role_insert",\Admin\RoleController::class ."@role_insert");
    Route::get("/role_edit/{id}",\Admin\RoleController::class ."@role_edit");
    Route::get("/role_edit_json/{id}",\Admin\RoleController::class ."@role_edit_json");
    Route::post("/role_update",\Admin\RoleController::class ."@role_update");
});
//权限管理
Route::prefix('admin')->group(function () {
    Route::get('/auth',function(){
        return view("admin.auth");
    });
    Route::get("/auth_table",\Admin\AuthController::class ."@auth_table");
    Route::get("/auth_add",\Admin\AuthController::class ."@auth_add");
    Route::post("/auth_select",\Admin\AuthController::class ."@auth_select");
    Route::post("/auth_insert",\Admin\AuthController::class ."@auth_insert");
    Route::get("/auth_edit/{id}",\Admin\AuthController::class ."@auth_edit");
    Route::post("/auth_update",\Admin\AuthController::class ."@auth_update");
    Route::post("/auth_user",\Admin\Base::class ."@auth");
});
//用户管理
Route::prefix('admin')->group(function () {
    Route::get('/user',function(){
        return view("admin.user");
    });
    Route::get("/userRows",\Admin\UserController::class ."@userRows");
    Route::post("/frz",\Admin\UserController::class ."@frz");
    Route::get('/user_add',function(){
        return view("admin.user_add");
    });
    Route::post("/user_select",\Admin\UserController::class ."@user_select");
    Route::post("/user_insert",\Admin\UserController::class ."@user_insert");
    Route::get("/user_edit/{id}",\Admin\UserController::class ."@user_edit");
    Route::post("/user_role_select/{id}",\Admin\UserController::class ."@user_role_select");
    Route::post("/user_update",\Admin\UserController::class ."@user_update");
});
//首页管理
Route::prefix('admin')->group(function () {
    Route::get('/home',function(){
        return view("home.home");
    });
    Route::get("/home_table",\Admin\HomeController::class ."@home_table");
    Route::get('/home_add',function(){
        return view("home.home_add");
    });
    Route::post("/home_insert",\Admin\HomeController::class ."@home_insert");
    Route::post("/upload",\Admin\HomeController::class ."@upload");
    Route::get("/home_edit/{id}",\Admin\HomeController::class ."@home_edit");
    Route::post("/home_update",\Admin\HomeController::class ."@home_update");
    Route::get("/home_delete",\Admin\HomeController::class ."@home_delete");
});

//用户管理
Route::prefix('admin')->group(function () {
    Route::get('/home/user',function(){
        return view("user.user");
    });
    Route::get("/home/userRows",\Admin\HomeUser::class ."@userRows");
    Route::post("/home/frz",\Admin\HomeUser::class ."@frz");
    Route::get('/home/user_add',function(){
        return view("user.user_add");
    });
    Route::get("/home/user_edit/{id}",\Admin\HomeUser::class ."@user_edit");
    Route::get("/home/user_update",\Admin\HomeUser::class ."@user_update");
    Route::get('/home/message/{id}',function($id){
        return view("user.user_message",['id'=>$id]);
    });
    Route::post("/home/user_insert",\Admin\HomeUser::class ."@user_insert");
    Route::post("/home/message_add",\Admin\HomeUser::class ."@message_add");
    Route::get("/home/user_del",\Admin\HomeUser::class ."@user_del");
});
//地址管理
Route::prefix('admin')->group(function () {
    Route::get('/address',function(){
        return view("admin.address.address");
    });
    Route::get("/address_table",\Admin\AddressController::class ."@address_table");
    Route::get('/address_add',function(){
        return view("admin.address.address_add");
    });
    Route::post("/address_insert",\Admin\AddressController::class ."@address_insert");
    Route::get("/address_edit/{id}",\Admin\AddressController::class ."@address_edit");
    Route::post("/address_update",\Admin\AddressController::class ."@address_update");
    Route::get("/address_del",\Admin\AddressController::class ."@address_del");
});
//服务介绍
Route::prefix('admin')->group(function () {
    Route::get('/introduce',function(){
        return view("admin.introduce.introduce");
    });
    Route::get("/introduce_table",\Admin\IndexController::class ."@introduce");
    Route::get('/introduce_add',function(){
        return view("admin.introduce.introduce_add");
    });
    Route::post("/introduce_insert",\Admin\IndexController::class ."@introduce_insert");
    Route::get("/introduce_edit/{id}",\Admin\IndexController::class ."@introduce_edit");
    Route::post("/introduce_update",\Admin\IndexController::class ."@introduce_update");
    Route::get("/introduce_del",\Admin\IndexController::class ."@introduce_del");
});
//日期时间管理
Route::prefix('admin')->group(function () {
    Route::get('/date',function(){
        return view("admin.date.date");
    });
    Route::get("/date_table",\Admin\DateController::class ."@date_table");
    Route::get("/date_add",\Admin\DateController::class ."@date_add");
    Route::post("/date_insert",\Admin\DateController::class ."@date_insert");
    Route::get("/date_edit/{id}",\Admin\DateController::class ."@date_edit");
    Route::post("/date_update",\Admin\DateController::class ."@date_update");
    Route::get("/date_del",\Admin\DateController::class ."@date_del");
});
//阿姨管理
Route::prefix('admin')->group(function () {
    Route::get('/aunt',function(){
        return view("admin.aunt.aunt");
    });
    Route::get("/aunt_table",\Admin\AuntController::class ."@aunt_table");
    Route::get('/aunt_add',function(){
        return view("admin.aunt.aunt_add");
    });
    Route::post("/aunt_insert",\Admin\AuntController::class ."@aunt_insert");
    Route::get("/aunt_edit/{id}",\Admin\AuntController::class ."@aunt_edit");
    Route::post("/aunt_update",\Admin\AuntController::class ."@aunt_update");
    Route::get("/aunt_del",\Admin\AuntController::class ."@aunt_del");
});
//退出登入
Route::get('/logout',function(\Illuminate\Http\Request $request){
    $request->session()->forget('username');
});
//前台路由
Route::prefix('index')->group(function () {
    Route::get('/login',function(){
        return view("index.login.login");
    });
    Route::get('/register',function(){
        return view("index.login.register");
    });
    Route::post("/user",\Index\LoginController::class ."@user");
    Route::post("/register_add",\Index\LoginController::class ."@register_add");
    Route::get('/login_out',function(\Illuminate\Http\Request $request){
        $request->session()->forget('name');
        return 1;
    });
});
//Route::get('getSystemInit','/admin/IndexController@getSystemInit');
